The name
attribute does not expose the set of <details>
as a named group. I wanted to mention this here because I see some confusion among developers as to what the name
attribute really does.
The HTML standard defines the behavior of the name
attribute saying that “the name
content attribute gives the name of the group of related details elements that the element is a member of.”
The “name of the group” referred to in this paragraph is not the accessible name of the group. The value of the name
attribute is not exposed to screen readers. And the name
attribute does not contribute to the accessible name computation of the group. We will learn about accessible names and how they are computed by the browser in up-and-coming chapters.
To give the group a meaningful role and
name, you’ll want to group the <details>
and give the group a name the way we did in the previous section.